Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better use of safety. #322

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Better use of safety. #322

merged 1 commit into from
Jan 21, 2025

Conversation

agheata
Copy link
Contributor

@agheata agheata commented Nov 29, 2024

Implementing two safety features:

  1. Safety caching: the tracks hold the point where safety is computed, and the safety value in that point. When safety is needed in a different point, the method track.GetSafety(new_point) will subtract from the cached value and return the positive remainder or zero otherwise. The GetSafety method can take an accurate limit value, and when the remainder is smaller than this limit the returned safety is zero. It is the user responsibility to call track.SetSafety(pos, safety) whenever the safety is fully recomputed in a new position.

  2. Safety calculation uses a new surface model feature only to compute safety accurately when close to boundaries, and only use the aligned bounding box safety when far away. The distance limit is passed as a third parameter to AdePTNavigator::ComputeSafety, and must be typically equal to the discrete interaction step.

@phsft-bot
Copy link

Can one of the admins verify this patch?

@agheata agheata marked this pull request as ready for review December 20, 2024 12:12
Copy link
Collaborator

@SeverinDiederichs SeverinDiederichs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR breaks this mac:
example1_ttbar.txt

It simply stalls and does not proceed, while on master it runs through.

Additionally, could the DEBUG_NO_SECONDARY 1 things be removed?

include/AdePT/core/Track.cuh Outdated Show resolved Hide resolved
include/AdePT/core/Track.cuh Outdated Show resolved Hide resolved
include/AdePT/core/Track.cuh Outdated Show resolved Hide resolved
include/AdePT/core/Track.cuh Outdated Show resolved Hide resolved
Implementing two safety features:

1. Safety caching: the tracks hold the point where safety is computed, and the safety value in that point. When safety is needed in a different point, the method track.GetSafety(new_point) will subtract from the cached value and return the positive remainder or zero otherwise. The GetSafety method can take an accurate limit value, and when the remainder is smaller than this limit the returned safety is zero. It is the user responsibility to call track.SetSafety(pos, safety) whenever the safety is fully recomputed in a new position.

2. Safety calculation usses a new surface model feature to only compute safety accurately when close to boundaries, and only use the aligned bounding box safety when far away. The distance limit is passed as third parameter to AdePTNavigator::ComputeSafety, and must be typically equal to the discrete interaction step.
Copy link
Collaborator

@SeverinDiederichs SeverinDiederichs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now

@agheata agheata merged commit 8462682 into apt-sim:master Jan 21, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants